﻿
namespace Leetcode.N6064;
public class Solution
{
    public int MaxConsecutive(int bottom, int top, int[] special)
    {
        special = special.OrderBy(_ => _).ToArray();

        var max = special[0] - bottom;
        for (int i = 1; i < special.Length; i++)
        {
            max = Math.Max(max, special[i] - special[i - 1] - 1);
        }

        max = Math.Max(max, top - special[special.Length-1]);
        return max;

    }
}